﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Net.Web
{
    /// <summary>
    /// http行为上下文
    /// </summary>
    public class HttpActionContext
    {
        /// <summary>
        /// http请求
        /// </summary>
        public HttpRequest Request { get; private set; }

        /// <summary>
        /// http响应
        /// </summary>
        public IHttpResponse Response { get; private set; }

        /// <summary>
        /// 响应是否已设置好值[true:响应已设置好值;false:响应需要继续设置值]
        /// </summary>
        public bool Handled { get; set; } = false;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="request">http请求</param>
        /// <param name="response">http响应</param>
        public HttpActionContext(HttpRequest request, IHttpResponse response)
        {
            this.Request = request;
            this.Response = response;
        }
    }
}
